<template>
  <div class="evaluation-result">
    <div class="text-title">{{ evaluation.titleName }}</div>
    <div class="flex-row-between">
      <span class="text-score">得分: {{ score }}</span>
      <span class="text-time">{{ evaluation.createTime }}</span>
    </div>
    <div class="evaluation-result__body">
      <div class="text-subtitle">评测结果</div>
      <div v-for="(item, index) in content" :key="index" class="text-normal">{{ item }}</div>
    </div>

    <fixed-bottom text="确定" @click="back" />
  </div>
</template>

<script>
import FixedBottom from '@/components/FixedBottom'
import { mapGetters } from 'vuex'
export default {
  components: {
    FixedBottom
  },
  data() {
    return {
    }
  },
  computed: {
    ...mapGetters(['evaluation']),
    score() {
      if (!this.evaluation.score && this.evaluation.score !== 0) {
        return ''
      }
      return this.evaluation.score + '分'
    },
    content() {
      return this.evaluation.result.split('\n')
    }
  },
  onReady() {
    console.log(JSON.stringify(this.evaluation.result))
  }
}
</script>

<style lang="less">
@import './index.less';
</style>
